package com.example.services;

import com.example.dao.PictureDao;
import com.example.pojo.Picture;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import utils.PaginationHelper;

/**
 * @Author 樊政启
 * @Date 2017/11/27
 */
@Service("PictureService")
public class PictureServiceImpl implements PictureService {

    @Autowired
    PictureDao pictureDao;

    public boolean putPicture(String userCode, String pictureUrl, String pictureDescription, int time) {
        Picture p = new Picture(userCode, pictureUrl, pictureDescription, time);
        return pictureDao.putPicture(p);
    }

    public PaginationHelper getPictures(String userCode, int page, int pageSize) {
        return pictureDao.getPictures(userCode, page, pageSize);
    }
}

interface PictureService {
    public boolean putPicture(String userCode, String pictureUrl, String pictureDescription, int time);
    public PaginationHelper getPictures(String userCode, int page, int pageSize);
}
